Auto-matching hidden layers in Pytorch LLMs